Write a custom CUDA kernel to optimize `STL` (Signed and Truncated Logarithm).

Formula:
  f(x) = alpha * x                      if |x| <= 1
  f(x) = alpha * sign(x) * (ln(|x|) + 1) if |x| > 1

Problem Analysis:
1. Memory Bound: This is an element-wise activation. Performance is limited by memory bandwidth.
2. Operator Chaining: The PyTorch implementation using `torch.where` and a chain of `abs`, `log`, `sign` creates multiple intermediate memory accesses.

Optimization Strategy: Fused Element-wise Kernel with Vectorization

1. One-Thread-per-Element: Map each element to a CUDA thread.

2. Vectorized Loads (float4): Use `float4` to process 128 bits per memory transaction.

3. Fused Branching Logic:
   - For each element `x`, get `abs_x = fabsf(x)`.
   - Check `if (abs_x > 1.0f)`.
   - If true, compute `log_val = __logf(abs_x) + 1.0f`. Result is `copysignf(log_val, x) * alpha`.
   - If false, result is `x * alpha`.
   - `copysignf` is an efficient way to apply the sign.

4. One-Pass: Fuse all steps into a single read-compute-write kernel.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

ALPHA_VALUE = 1.0

class STL(nn.Module):
    """
    Signed and Truncated Logarithm (STL) Activation.
    "STL: A Signed and Truncated Logarithm Activation Function for Neural Networks" (arXiv, 2023)
    Formula:
      f(x) = alpha * x                      if |x| <= 1
      f(x) = alpha * sign(x) * (ln(|x|) + 1) if |x| > 1
    """
    def __init__(self, alpha=1.0):
        super(STL, self).__init__()
        self.alpha = alpha

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        abs_x = torch.abs(x)
        
        linear_part = self.alpha * x
        log_part = self.alpha * torch.sign(x) * (torch.log(abs_x) + 1.0)
        
        return torch.where(abs_x <= 1.0, linear_part, log_part)

class Model(nn.Module):
    def __init__(self, alpha=1.0):
        super(Model, self).__init__()
        self.act = STL(alpha=alpha)
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32) * 2.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    return [ALPHA_VALUE]